 {yun:}include file="$wapstyle/header_cont.htm"{/yun}
<link rel="stylesheet" href="{yun:}$wap_style{/yun}/css/company_pj.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<script src="{yun:}$wap_style{/yun}/js/mui/mui.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/mui/mui.zoom.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/mui/mui.previewimage.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<style type="text/css">
  
  *{ touch-action: none; }
  .mui-pull-bottom-pocket, .mui-block{display: none !important;} 
  .mui-scroll-wrapper{top:100px; background-color: #fff; }
  .mui-scroll{background-color: #fff;}
  .tab{position: relative;}
  .active i {width: 25px;display: inline-block;height: 1.5px;background: #64a3f7;position: absolute;bottom: 0;left: 30%;}
</style>

   <section class="pj_list">

        <div class="list_hd">
             
             <a class="tab  {yun:}if $smarty.get.type==0{/yun} active {yun:}/if{/yun}" href="{yun:}url m=wap c=company a=show_pj_list id=$smarty.get.id type=0{/yun}">全部<i></i></a>
             <a class="tab {yun:}if $smarty.get.type==1{/yun} active {yun:}/if{/yun}" href="{yun:}url m=wap c=company a=show_pj_list id=$smarty.get.id type=1{/yun}">最新({yun:}$new_num{/yun})<i></i></a>
             <a class="tab  {yun:}if $smarty.get.type==2{/yun} active {yun:}/if{/yun}" href="{yun:}url m=wap c=company a=show_pj_list id=$smarty.get.id type=2{/yun}">好评({yun:}$good_num{/yun})<i></i></a>
             <a class="tab  {yun:}if $smarty.get.type==3{/yun} active {yun:}/if{/yun}" href="{yun:}url m=wap c=company a=show_pj_list id=$smarty.get.id type=3{/yun}">差评({yun:}$bad_num{/yun})<i></i></a>
        </div>

       
        <div class="list_bd mui-scroll-wrapper">
          
              <ul class="evaluation_list mui-scroll">

                <!--  <li class="evaluation_item">
                       <div class="evaluation_person">
                        <div class="avatar_img">
                         <img class="evaluation_avatar" src="../app/template/wap/images/avatar_girl.png" />
                       </div>

                        <div class="name_zhiwei">
                            <span class="name">赵****杰</span>
                            <span class="zhiwei">面试职位：运营(实习生(已下线)面试职位：运营(实习生(已下线)面试职位：运营(实习生(已下线)面试职位：运营(实习生(已下线)面试职位：运营(实习生(已下线)面试职位：运营(实习生(已下线)面试职位：运营(实习生(已下线)面试职位：运营(实习生(已下线)面试职位：运营(实习生(已下线)</span>
                        </div>
                        <div class="star_date">
                            <div class="star_group"> 
                             <img class="star" src="../app/template/wap/images/star-yello.png" />
                             <img class="star" src="../app/template/wap/images/star-yello.png" />
                             <img class="star" src="../app/template/wap/images/star-yello.png" />
                             <img class="star" src="../app/template/wap/images/star-yello.png" />
                             <img class="star" src="../app/template/wap/images/star-gray.png" />
                             <div class="clear"></div>
                            </div>
                             <span class="date">03月16日</span>
                        </div>
                    </div>
                    <div class="evaluation_label">
                      <span>环境好</span>
                      <span>环境高大上</span>
                    </div>
                    <div class="pj_txt">
                      面试过程：面试过程很轻松，环境特别好
                     </div>
                    <div class="bot_info">
                       <img src="../app/template/wap/images/shou_icon.png" />
                       <span>有用(2)</span>
                    </div>

                      </li> -->
                    </ul>


                 <div id="loadings" style="height:30px;line-height:30px; width:100%; position: fixed; bottom: 10px; z-index: 10; text-align: center; color:#666">
                    <img style="width:28px; vertical-align: middle;" src="../app/template/wap/images/loading.gif" />加载中....
               </div>
         </div>

        

   </section> 


 <script>

   var comid = '{yun:}$smarty.get.id{/yun}';
   var type = '{yun:}$smarty.get.type{/yun}'
    var page = 0;
    mui.init({
      pullRefresh : {
        container:'.list_bd',//待刷新区域标识，querySelector能定位的css选择器均可，比如：id、.class等
        up : {
          height:100,//可选.默认50.触发上拉加载拖动距离
          auto:true,//可选,默认false.自动上拉加载一次
          contentrefresh : "正在加载...",//可选，正在加载状态时，上拉加载控件上显示的标题内容
          contentnomore:'没有更多数据了',//可选，请求完毕若没有更多数据时显示的提醒内容；
          callback : function (){
                    $('#loadings').show();
                    var self = this;
                    page+=1; 
                    $.post('{yun:}$config.sy_weburl{/yun}/wap/index.php?c=company&a=ajax_list',{
                       page:page,
                       comid:comid,
                       type
                    },function(res){
                        res = JSON.parse(res);
                        console.log(res);

                        if(res.length==0){                           
                            self.disablePullupToRefresh();                           
                        }
                         
                        processorData(res);                       
                    });

                   self.endPullupToRefresh(false);
                 } //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
        }
      }
    });

  

   function processorData(res){

      var htmlstr=``;

      if(!res.toString()){

            $('.evaluation_list').append('<li class="evaluation_item" id="tishi" style="min-height:30px;line-height:30px; width:100%;bottom: 20px;text-align: center;  color:#666; border-bottom:0;">没有数据了</li>');
                 $('#loadings').hide();
                 return false;

      }

        
        for(let data of res){
               
                 htmlstr+=`
              
                          <li class="evaluation_item">
                             <div class="evaluation_person">
                                 <div class="avatar_img">`;

                                  if(data.sex==1){

                htmlstr+=`          <img class="evaluation_avatar" src="${data.userhead}" onerror="showImgDelay(this,'{yun:}$config.sy_weburl{/yun}/{yun:}$config.sy_member_icon{/yun}',2);"/>`;

                                  }else{

               htmlstr+=`              <img class="evaluation_avatar" src="${data.userhead}" onerror="showImgDelay(this,'{yun:}$config.sy_weburl{/yun}/{yun:}$config.sy_member_iconv{/yun}',2);"/>`;

                                  };


                htmlstr+=`

                                </div>

                                 <div class="name_zhiwei">
                                     <span class="name">${data.username}</span>
                                     <span class="zhiwei">面试职位：${data.job_name}(已下线)</span>
                                 </div>
                                 <div class="star_date">
                                     <div class="star_group">`;
                                   

                                      for(let score of data.score){
                                          if(score==1){
                                              htmlstr+=`<img class="star" src="../app/template/wap/images/star-yello.png" />`;
                                          }else{

                                             htmlstr+=`<img class="star" src="../app/template/wap/images/star-gray.png" />`;
                                          }

                                      }
                                   

              htmlstr+=`
                                      <div class="clear"></div>
                                     </div>
                                      <span class="date">${data.date}</span>
                                 </div>
                             </div>
                             <div class="evaluation_label">`;
                             if(data.label.length>0){
                               for(let a of data.label){
                                  htmlstr+=`<span>${a}</span>`;
                               }
                            }
                                                                                         
                            htmlstr+=`

                             </div>
                             <div class="pj_txt">
                               面试过程：${data.cont}
                              </div>
                             <div class="bot_info" data-id="">
                               
                                <img src="${data.is_like==1?'../app/template/wap/images/zan_blue.png':'../app/template/wap/images/shou_icon.png'}" data-id="${data.id}"/>

                                <span>有用(<span class="zan_num">${data.zan_num}</span>)</span>
                             </div>
                         </li>

      `;

        }

        $('#loadings').hide();
        
        $('.evaluation_list').append(htmlstr);

   }



 </script>


<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/layer/layer.m.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/prefixfree.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<link rel="stylesheet" href="{yun:}$wap_style{/yun}/js/swiper/swiper.min.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
<script src="{yun:}$wap_style{/yun}/js/swiper/swiper.min.js?v={yun:}$config.cachecode{/yun}"></script>

<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/js/mui/css/mui.previewimage.css?v={yun:}$config.cachecode{/yun}" type="text/css" />



<script type="text/javascript">

  $(function(){
     mui(".evaluation_list").on("tap",".bot_info img", function(event){
           //alert(this.dataset.id);
           console.log($(this).parents('.bot_info').find('.zan_num'));
           var cur_zan_num =  parseInt($(this).parents('.bot_info').find('.zan_num').text());
           var zan_num_dom=$(this).parents('.bot_info').find('.zan_num');
           var comment_id = this.dataset.id;
            that = this;
            $.ajax({
              type: "post",
              dataType: "json",
              url: '{yun:}$config.sy_weburl{/yun}/wap/index.php?c=company&a=ajax_com_like',
              data: {comment_id},
              success: function (data) {
                  console.log(data);

                  if(data.code==1){

                      layermsg('请登录后点赞！');
                      return false;
                  }


                  if(data.is_liked==1){ //曾经点赞过

                     if(data.status==1){
                        $(that).attr('src','../app/template/wap/images/shou_icon.png');
                       zan_num_dom.text(cur_zan_num-1);
                     }else{
                        $(that).attr('src','../app/template/wap/images/zan_blue.png');
                        zan_num_dom.text(cur_zan_num+1);
                     }
                    
                     
                  }else{ //曾经没有点赞
                     //alert('aaaaa');
                     $(that).attr('src','../app/template/wap/images/zan_blue.png');
                     
                     zan_num_dom.text(cur_zan_num+1);


                  }
              }
          });




     })
 });


</script>

